// 布尔值
let isdown: boolean = false;
// console.log(isdown);
// 数字
let num: number = 32;
// console.log(num);
// 字符串
let str: string = 'hello';
// console.log(str);
// 数组
let arr: number[] = [1];
let arr1: Array<string> = ['sssss'];
// 元组
let arr2: [string, number] = ['sssss', 1];
// console.log(arr2);

// 枚举类型
enum Color {
    Red = 'red',
    Green = 'green',
    Blue = 'blue',
}
// console.log(Color.Blue);
// console.log(Color.Red);
// any 类型
let any: any = 'any';
any = 1;
// console.log(any);

let unmounted: void = undefined;
console.log(unmounted);
// never 类型
function fail() {
    return Error('Something failed');
}
fail();
// console.log(error);

// function create(o: object | null): Object {
//     return o;
// }

// create(null); // Error
// create('string'); // Error
// create('string'); // Error
let someValue: any = 'this is a string';
// let strlength: number = (<string>someValue).length;
let strlength: number = (someValue as string).length;
